#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int a, b, c;
	char d;
	scanf("%1d-%3d-%5d-%c", &a, &b, &c, &d);
	int sum = a;
	int k = 4;
	int a1 = a, b1 = b, c1 = c;
	while (b) {
		sum += b % 10 * k;
		k--;
		b /= 10;
	}
	k = 9;
	while (c) {
		sum += c % 10 * k;
		k--;
		c /= 10;
	}
	char x = 'X';
	int ans = sum % 11;
	int d1 = d - '0';
	if (ans == 10) {
		if (d == 'X') {
			cout << "Right" << endl;
			return 0;
		}
		else {
			printf("%1d-%3d-%5d-%c", a1, b1, c1, x);
		}
	}
	else {
		if (ans == d1) {
			cout << "Right" << endl;
			return 0;
		}
		else {
			printf("%1d-%3d-%5d-%1d", a1, b1, c1, ans);
		}
	}
	return 0;
}